export const isPhoneNumber = (text: string) => {
    if (/^[0-9]{1,11}$/.test(text)) {
        return true;
    } else {
        return false;
    }
}

export const isEmailAddress = (text: string) => {
    if (/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(text)) {
        return true;
    } else {
        return false;
    }
}

export const isPhoneNumberOrEmailAddress = (text: string) => {
    return isPhoneNumber(text) || isEmailAddress(text);
}